package com.agileboot.domain.airport.inspection.dto;

import cn.hutool.core.bean.BeanUtil;
import com.agileboot.common.annotation.ExcelColumn;
import com.agileboot.domain.airport.inspection.db.SirInspectionEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * @author valarchie
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SirInspectionDTO {

    public SirInspectionDTO(SirInspectionEntity entity) {
        if (entity != null) {
            BeanUtil.copyProperties(entity, this);
        }
    }

    @ExcelColumn(name = "检查Id")
    private Long inspectionId;

    @ExcelColumn(name = "检查名称")
    private String inspectionName;

    @ExcelColumn(name = "检查来源")
    private String inspectionSource;

    @ExcelColumn(name = "开始时间")
    private Date startTime;

    @ExcelColumn(name = "结束时间")
    private Date endTime;

    @ExcelColumn(name = "检查内容")
    private String inspectionContent;

    @ExcelColumn(name = "检查对象")
    private Long inspectionDeptId;

    @ExcelColumn(name = "创建者")
    private String createBy;

    @ExcelColumn(name = "创建时间")
    private Date createTime;

    @ExcelColumn(name = "更新者")
    private String updateBy;

    @ExcelColumn(name = "更新时间")
    private Date updateTime;

    @ExcelColumn(name = "备注")
    private String remark;

    @ExcelColumn(name = "状态")
    private String status;

    @ExcelColumn(name = "计划日期")
    private Date planDate;

    @ExcelColumn(name = "检查编号")
    private String inspectionCode;

    @ExcelColumn(name = "检查条款")
    private Long checkCount;

    @ExcelColumn(name = "检查符合条款")
    private Long checkOkCount;

    @ExcelColumn(name = "检查类型")
    private String inspectionType;

    @ExcelColumn(name = "检查周期")
    private String inspectionPeriod;

    @ExcelColumn(name = "检查级别")
    private String inspectionLevel;

    @ExcelColumn(name = "审批人")
    private Long approver;

    @ExcelColumn(name = "检查部门")
    private Long deptId;

    @ExcelColumn(name = "检查小组")
    private String checkUseridList;

    @ExcelColumn(name = "小组组长id")
    private Long checkUserId;

    @ExcelColumn(name = "创建者id")
    private Long creatorId;

    @ExcelColumn(name = "更新者id")
    private Long updaterId;

    @ExcelColumn(name = "删除标记")
    private Boolean deleted;

    @ExcelColumn(name = "检查部门名称")
    private String deptName;

    @ExcelColumn(name = "检查人员姓名列表")
    private List<String> userNameList;

    // 新增字段：检查项目数量
    @ExcelColumn(name = "检查项目数量")
    private Long checkItemCount;

    // 新增字段：检查进度，百分比形式，保留两位小数
    @ExcelColumn(name = "检查进度")
    private Double checkProgress;

    @ExcelColumn(name = "审批意见")
    private String suggestion;

    // 新增检查类型字段
    @ExcelColumn(name = "检查类型详情")
    private InspectionTypeDetail inspectionTypeDetail;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class InspectionTypeDetail {
        private String label;
        private String value;
    }
}